flat assembler
Message board for the users of flat assembler.

Index > DOS > FASM finds error in "pop"

Author
Thread Post new topic Reply to topic
Necromancer13



Joined: 18 Oct 2007
Posts: 32
Location: Ukraine
Necromancer13
Why does'nt FASM compile it?Sad
It finds an error in "pop cx"Sad
But why?Sad

Code:
        org        100h                 ; !-?@>3@0<<0
        mov        ah,2                 ; DC=:F8O 02 ?@5@K20=8O 1Ah
        int        1Ah                  ; ?>;CG8BL B5:CI55 2@5<O
        mov        ch,dh                ; A>E@0=8BL B5:CICN A5:C=4C 2 !
        mov        cl,0100b             ; CL = A>AB>O=85 A25B>48>4>2 :;0280BC@K
main_loop:
        call       change_LEDs          ; CAB0=>28BL A25B>48>4K 2 A>>B25BAB288 A CL
        shl        cl,1                 ; A;54CNI89 A25B>48>4,
        test       cl,1000b             ; 5A;8 548=8F0 2KH;0 2 18B 3,
        jz         continue
        mov        cl,0001b             ; 25@=CBL 55 2 18B 0,
continue:
        mov        ah,1                 ; ?@>25@8BL, =5 1K;0 ;8 =060B0 :;028H0,
        int        16h
        jnz        exit_loop            ; 5A;8 40 - 2K9B8 87 ?@>3@0<<K
        push       cx
        mov        ah,2                 ; DC=:F8O 02 ?@5@K20=8O 1Ah
        int        1Ah                  ; ?>;CG8BL B5:CI55 2@5<O
        pop        AE
        cmp        ch,dh                ; A@02=8BL B5:CICN A5:C=4C 2 DH A !,
        mov        ch,dh                ; A:>?8@>20BL 55 2 ;N1>< A;CG05,
        je         continue             ; 5A;8 MB> 1K;0 B0 65 A0<0O A5:C=40 - =5
                                        ; ?5@5:;NG0BL A25B>48>4K,
        jmp        short main_loop      ; 8=0G5 - ?5@5:;NG8BL A25B>48>4K
exit_loop:
        mov        ah,0                 ; 2KE>4 87 F8:;0 - 1K;0 =060B0 :;028H0,
        int        16h                  ; AG8B0BL 55
        ret                             ; 8 7025@H8BL ?@>3@0<<C

; ?@>F54C@0 change_LEDs
; CAB0=02;8205B A>AB>O=85 A25B>48>4>2 :;0280BC@K 2 A>>B25BAB288 A G8A;>< 2 CL
proc change_LEDs
        call       wait_KBin            ; >6840=85 2>7<>6=>AB8 ?>AK;:8 :><0=4K
        mov        al,0EDh
        out        60h,al               ; :><0=40 :;0280BC@K EDh
        call       wait_KBin            ; >6840=85 2>7<>6=>AB8 ?>AK;:8 :><0=4K
        mov        al,cl
        out        60h,al               ; =>2>5 A>AB>O=85 A25B>48>4>2
        ret
endp

; ?@>F54C@0 wait_KBin
; >6840=85 2>7<>6=>AB8 22>40 :><0=4K 4;O :;0280BC@K
proc wait_KBin
        in         al,64h               ; ?@>G8B0BL A;>2> A>AB>O=8O
        test       al,0010b             ; 18B 1 @025= 1?
        jnz        wait_KBin            ; 5A;8 =5B - 640BL,
        ret                             ; 5A;8 40 - 2K9B8
endp


    

_________________
FASM Rulezzzzzz!
Post 01 Nov 2007, 18:33
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen
Azbuka problem? I can't see any pop cx.
Code:
pop AE    
Post 01 Nov 2007, 18:40
View user's profile Send private message Visit poster's website Reply with quote
Necromancer13



Joined: 18 Oct 2007
Posts: 32
Location: Ukraine
Necromancer13
Oh... It's some error with encoding... I've wrote "pop cx"!
Russian symbols also were encoded...
Post 01 Nov 2007, 18:50
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
eek



Joined: 21 Oct 2006
Posts: 24
eek
Might be your

mov ah,2
int 1Ah

try
mov ax,0200
Post 03 Nov 2007, 01:15
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.