First assembly program error -


i have written asm program try teach myself asm. doesn't seem working in emu8086, , have absolutely no idea why.

org 100h      mov dx, 05 cld while:    int 21h    cmp dx, 1    jz outt    dec dx     mov ah, 09h    int 21h     jmp while outt:    mov ah, 4ch    mov al, 00    int 21h     ret 

the bleak world of assembler no place uninitiated venture without guide...

your atlas great tome of ralf - importantly, chapter 21h.

the first thing doing setting dx 5. why you'd want unknown, since haven't commented action.

then clearing direction flag cld. sensible - ensures auto-adjustment of registers in string instructions proceeds in logical direction.

your next action puzzling. when execute int 21h you're asking os something. if refer atlas, you'll find operation executed depends on value in ah. currently, that's 0, since you've not explicitly set in program. hence, if visit verse 00 of chapter 21h of tome of ralf may find out why program appears terminate without having appeared have done anything.

if indeed shun particular instruction, others have advised, observe next steps

  • compare dx 1
  • probably find unequal, don't jump
  • decrement value of dx 1
  • assign 09 ah

now have magic mantra ask os again - what? still got atlas? perhaps verse 09 may out. aware value in dx may intimately involved here.

having done that, last few steps repeated until dx=1, @ point jump outt.

again load ah may magic value - , al, too. want atlas find out should do?


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -