I am having a little trouble with an assignment that I have to complete in emu8086. What I have to do is, as the teacher states:
Here is the code that I have so far:
The four lines in red are what I have to change/make. Please help!
Quote:Write two lines to push a byte stored in dh on to myStack.
Write two lines to pop a byte stored in myStack into dl.
Here is the code that I have so far:
Code
;kevin o'keeffe
org 100h
jmp START
myStack db 8 dup (?)
_myStackSize equ 8
START:
mov si, _myStackSize ;si holds size of myStack
mov dh, '1' ;move '1' (which is ascii 31) to dh
mov cx,5 ;Wish to execute loop body 5 times (must use cx with loop command)
PUSH_LOOP:
;push myStack
[color=#FF0000]mov si, 0h [/color] ;change si so myStack[si] is the new top of myStack
[color=#FF0000]mov dh, myStack(si)[/color] ;mov dh to the new top of myStack
inc dh
loop PUSH_LOOP ;dec cx jnz PUSH_LOOP
mov cx,5
POP_LOOP: ;Wish to execute loop body 5 times (must use cx with loop command)
;pop myStack
;[color=#FF0000]??? [/color] ;mov (ie copy) the top element of myStack to dl
;[color=#FF0000]??? [/color] ;change si so myStack[si] is the new top of myStack
mov ah, 02h ;Send rv
int 21h ;to screen
;Advance screen to new print line
mov ah, 02h
mov dl,0Dh
int 21h
mov dl,0Ah
int 21h
loop POP_LOOP ;dec cx jnz PUSH_LOOP
retThe four lines in red are what I have to change/make. Please help!

