Thursday, 15 April 2010

Learning x86 assembly language. Need some instructions -



Learning x86 assembly language. Need some instructions -

i'm trying understand x86 assembly language on given example. please give me advice code? code isn't mine comments are.

bits 16 ; means? org 100h ; means? section .bss ; section info tekst resb50 ; variable tekst type resb50 section .text ; main application instructions mov si,tekst ; re-create value of tekst si. value contains 'tekst'? et1: ; label et1 mov ah,01h ; interrupt read input int 21h ; phone call interrupt mov [si],al ; re-create al [si]. why al? why square brackets? cmp al,'0' ; compare al info '0' je petla ; if equal jump petla inc si ; increment si jmp et1 ; jump et1 mov ah,'w' ; re-create 'w' ah mov si,tekst ; re-create tekst si. petla: cmp byte [si], '0' ; compare '0' [si] info je et3 ; if equal jump et3 cmp ah,[si] ; compare [si] info ah je et2 ; if qual jump et2 inc si jmp petla ; jump petla

am wrong above comments?

bits , org directives compiler.

bits sets flavor of code generate (16-bit , 32-bit commands differ little same operands)

org 100h tells compiler skip 256 bytes in resulting image. com file source - in com files, first 256 bytes of segment occupied header directive needed.

in general, larn assembler, it's improve read book on real-mode 1 - explain general cpu architecture , workings executable files inner construction , handling os. can recommend ones in native russian.

assembly x86 ms-dos

No comments:

Post a Comment