Conditions Calls

x86 / x64 programming
Post Reply
User avatar
madaxe
Posts: 13
Joined: Mon Apr 27, 2020 4:59 pm

Conditions Calls

Post by madaxe » Fri Jun 25, 2021 5:18 pm

Hi there;

In 8086 assembly is there something like Conditions Calls like the good old Z80? Something like call nc, call nz, etc?

User avatar
akuyou
Posts: 563
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Re: Conditions Calls

Post by akuyou » Mon Jun 28, 2021 3:29 am

There isn't in 8086, If you want to do a 'conditional call', you should jump over the call statement when the condition is not true

For example if you want to call if Zero:

Code: Select all

    JNZ NoCall
        CALL CallIfZero
    NoCall:
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

User avatar
madaxe
Posts: 13
Joined: Mon Apr 27, 2020 4:59 pm

Re: Conditions Calls

Post by madaxe » Tue Jun 29, 2021 1:46 pm

akuyou wrote: Mon Jun 28, 2021 3:29 am There isn't in 8086, If you want to do a 'conditional call', you should jump over the call statement when the condition is not true

For example if you want to call if Zero:

Code: Select all

    JNZ NoCall
        CALL CallIfZero
    NoCall:
Thank you, Keith! I thought that was something like that :-P
Just ordered your book from Amazon UK. Hope Brexit doesn't bring me many troubles, lol!

Best regards,
José Mário aka MadAxe

Post Reply

Return to “8086 Assembly Programming”