MASM/Bitwise or
Jump to navigation
Jump to search
globals.masm
nine ptr-size arg arg1 ret old-ipt
or.masm
tmp lab or cmt tmp = not(arg) alc one get arg nnd vpt set tmp cmt ret = nand(not(arg1), tmp) alc one get arg1 nnd vpt nnd tmp fre tmp set ret cmt set ipt to old-ipt + 9 to skip function call alc nine set tmp adr old-ipt get nine drf vpt fre tmp set ipt
main.masm
or loop tmp two new-out lab loop cmt call loop alc ptr-size set tmp adr loop drf vpt fre tmp set ipt lab main cmt init nine/ptr-size alc one get one rot one rot one rot one rot one rot one nnd vpt set tmp alc one get one nnd vpt nnd tmp fre tmp set nine cmt copies 0th byte of in to arg alc one get in set arg cmt copies 1st byte of in to arg1 alc ptr-size set tmp adr in get one drf vpt fre tmp set tmp alc one get tmp set arg1 cmt set old-ipt alc ptr-size set tmp adr ipt drf vpt fre tmp set old-ipt cmt call or alc ptr-size set tmp adr or drf vpt fre tmp set ipt cmt init two alc one get one rot one rot one rot one rot one rot one rot one rot one set two cmt alloc new-out and sets 0th byte to ret from or alc two get ret set new-out cmt null terminates new-out alc ptr-size set tmp adr new-out get one drf vpt fre tmp cmt abusing the fact that out is currently 0 get out cmt out = new-out alc ptr-size set tmp adr new-out drf vpt fre tmp set out cmt clean-up (in case we want to add more code) fre arg fre arg1 fre ret fre two cmt call loop alc ptr-size set tmp adr loop drf vpt fre tmp set ipt