| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564 |
- ;
- ; Command & Conquer Red Alert(tm)
- ; Copyright 2025 Electronic Arts Inc.
- ;
- ; This program is free software: you can redistribute it and/or modify
- ; it under the terms of the GNU General Public License as published by
- ; the Free Software Foundation, either version 3 of the License, or
- ; (at your option) any later version.
- ;
- ; This program is distributed in the hope that it will be useful,
- ; but WITHOUT ANY WARRANTY; without even the implied warranty of
- ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ; GNU General Public License for more details.
- ;
- ; You should have received a copy of the GNU General Public License
- ; along with this program. If not, see <http://www.gnu.org/licenses/>.
- ;
- ;***************************************************************************
- ;** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S **
- ;***************************************************************************
- ;* *
- ;* Project Name : 16 bit ASM Macros *
- ;* *
- ;* File Name : PCMACRO.16 *
- ;* *
- ;* Programmer : Steve Tall *
- ;* *
- ;* Start Date : November 17th, 1995 *
- ;* *
- ;* Last Update : November 20th, 1995 [ST] *
- ;* *
- ;*-------------------------------------------------------------------------*
- ;* Functions: *
- ;* *
- ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
- saveall macro
- save ax,bx,cx,dx,bp,si,di,es,ds
- endm
- restall macro
- restore ax,bx,cx,dx,bp,si,di,es,ds
- endm
- save macro r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14
- IFNB <r0>
- push r0
- save r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14
- ENDIF
- endm
- restore macro r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14
- IFNB <r14>
- pop r14
- ENDIF
- IFNB <r13>
- pop r13
- ENDIF
- IFNB <r12>
- pop r12
- ENDIF
- IFNB <r11>
- pop r11
- ENDIF
- IFNB <r10>
- pop r10
- ENDIF
- IFNB <r9>
- pop r9
- ENDIF
- IFNB <r8>
- pop r8
- ENDIF
- IFNB <r7>
- pop r7
- ENDIF
- IFNB <r6>
- pop r6
- ENDIF
- IFNB <r5>
- pop r5
- ENDIF
- IFNB <r4>
- pop r4
- ENDIF
- IFNB <r3>
- pop r3
- ENDIF
- IFNB <r2>
- pop r2
- ENDIF
- IFNB <r1>
- pop r1
- ENDIF
- IFNB <r0>
- pop r0
- ENDIF
- endm
- bhi macro lab
- ja lab
- endm
- bls macro lab
- jbe lab
- endm
- bcc macro lab
- jnc lab
- endm
- bcs macro lab
- jc lab
- endm
- bhs macro lab
- jnc lab
- endm
- blo macro lab
- jc lab
- endm
- bne macro lab
- jne lab
- endm
- beq macro lab
- je lab
- endm
- bpl macro lab
- jns lab
- endm
- bmi macro lab
- js lab
- endm
- bge macro lab
- jge lab
- endm
- blt macro lab
- jl lab
- endm
- bgt macro lab
- jg lab
- endm
- ble macro lab
- jle lab
- endm
- bra macro lab
- jmp lab
- endm
- bhis macro lab
- ja lab
- endm
- blss macro lab
- jbe lab
- endm
- bccs macro lab
- jnc lab
- endm
- bcss macro lab
- jc lab
- endm
- bnes macro lab
- jne lab
- endm
- beqs macro lab
- je lab
- endm
- bpls macro lab
- jns lab
- endm
- bmis macro lab
- js lab
- endm
- bges macro lab
- jge lab
- endm
- blts macro lab
- jl lab
- endm
- bgts macro lab
- jg lab
- endm
- bles macro lab
- jle lab
- endm
- bras macro lab
- jmp lab
- endm
- clear macro first
- xor first,first
- endm
- rts macro
- ret
- endm
- mov_b macro label,label2
- mov byte ptr label,byte ptr label2
- endm
- mov_w macro label,label2
- mov word ptr label,word ptr label2
- endm
- mov_d macro label,label2
- mov dword ptr label,dword ptr label2
- endm
- cmp_b macro label,label2
- cmp byte ptr label,byte ptr label2
- endm
- cmp_w macro label,label2
- cmp word ptr label,word ptr label2
- endm
- cmp_d macro label,label2
- cmp dword ptr label,dword ptr label2
- endm
- add_b macro label,label2
- add byte ptr label,byte ptr label2
- endm
- add_w macro label,label2
- add word ptr label,word ptr label2
- endm
- add_d macro label,label2
- add dword ptr label,dword ptr label2
- endm
- sub_b macro label,label2
- sub byte ptr label,byte ptr label2
- endm
- sub_w macro label,label2
- sub word ptr label,word ptr label2
- endm
- sub_d macro label,label2
- sub dword ptr label,dword ptr label2
- endm
- or_b macro label,label2
- or byte ptr label,byte ptr label2
- endm
- or_w macro label,label2
- or word ptr label,word ptr label2
- endm
- or_d macro label,label2
- or dword ptr label,dword ptr label2
- endm
- xor_b macro label,label2
- xor byte ptr label,byte ptr label2
- endm
- xor_w macro label,label2
- xor word ptr label,word ptr label2
- endm
- xor_d macro label,label2
- xor dword ptr label,dword ptr label2
- endm
- eor_b macro label,label2
- xor byte ptr label,byte ptr label2
- endm
- eor_w macro label,label2
- xor word ptr label,word ptr label2
- endm
- eor_d macro label,label2
- xor dword ptr label,dword ptr label2
- endm
- and_b macro label,label2
- and byte ptr label,byte ptr label2
- endm
- and_w macro label,label2
- and word ptr label,word ptr label2
- endm
- and_d macro label,label2
- and dword ptr label,dword ptr label2
- endm
- test_b macro label,label2
- test byte ptr label,byte ptr label2
- endm
- test_w macro label,label2
- test word ptr label,word ptr label2
- endm
- test_d macro label,label2
- test dword ptr label,dword ptr label2
- endm
- shr_b macro label,label2
- shr byte ptr label,label2
- endm
- shr_w macro label,label2
- shr word ptr label,label2
- endm
- shr_d macro label,label2
- shr dword ptr label,label2
- endm
- shl_b macro label,label2
- shl byte ptr label,label2
- endm
- shl_w macro label,label2
- shl word ptr label,label2
- endm
- shl_d macro label,label2
- shl dword ptr label,label2
- endm
- sar_b macro label,label2
- sar byte ptr label,label2
- endm
- sar_w macro label,label2
- sar word ptr label,label2
- endm
- sar_d macro label,label2
- sar dword ptr label,label2
- endm
- sal_b macro label,label2
- sal byte ptr label,label2
- endm
- sal_w macro label,label2
- sal word ptr label,label2
- endm
- sal_d macro label,label2
- sal dword ptr label,label2
- endm
- inc_b macro label
- inc byte ptr label
- endm
- inc_w macro label
- inc word ptr label
- endm
- inc_d macro label
- inc dword ptr label
- endm
- dec_b macro label
- dec byte ptr label
- endm
- dec_w macro label
- dec word ptr label
- endm
- dec_d macro label
- dec dword ptr label
- endm
- movzx_b macro label,label2
- movzx label,byte ptr label2
- endm
- movzx_w macro label,label2
- movzx label,word ptr label2
- endm
- movsx_b macro label,label2
- movsx label,byte ptr label2
- endm
- movsx_w macro label,label2
- movsx label,word ptr label2
- endm
- mul_b macro label
- mul byte ptr label
- endm
- mul_w macro label
- mul word ptr label
- endm
- div_b macro label
- div byte ptr label
- endm
- div_w macro label
- div word ptr label
- endm
- idiv_b macro label
- idiv byte ptr label
- endm
- idiv_w macro label
- idiv word ptr label
- endm
- tst_b macro label
- cmp byte ptr label,0
- endm
- tst_w macro label
- cmp word ptr label,0
- endm
- tst_d macro label
- cmp dword ptr label,0
- endm
- not_b macro label
- not byte ptr label
- endm
- not_w macro label
- not word ptr label
- endm
- not_d macro label
- not dword ptr label
- endm
- neg_b macro label
- neg byte ptr label
- endm
- neg_w macro label
- neg word ptr label
- endm
- neg_d macro label
- neg dword ptr label
- endm
|