[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
Pete's QBASIC Site Discuss QBasic, Freebasic, QB64 and more 2021-02-26T14:02:52-05:00 http://www.petesqbsite.com/phpBB3/app.php/feed/topic/14845 2021-02-26T14:02:52-05:00 2021-02-26T14:02:52-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39073#p39073 <![CDATA[Re: properly formatting asm code to make it QB ready]]>
Last thing I want to see is for a QB program to not compile because the "expression is too complex". so It would make sense to use mkl$(zyxw) instead of chr$(w)+chr$(x)+chr$(y)+chr$(z). I figure these things out through experimentation.

Anyone who wants to experiment now can try this:

Code:

clsif mkl$(&H11223344)=chr$(&H44)+chr$(&H33)+chr$(&H22)+chr$(&H11) then print "equal"if mkl$(&H11223344)=chr$(&H11)+chr$(&H22)+chr$(&H33)+chr$(&H44) then print "equal"
And the word "equal" will appear once on the screen if the code above is run as-is.

Statistics: Posted by mikefromca — Fri Feb 26, 2021 2:02 pm


]]>
2021-02-23T01:29:38-05:00 2021-02-23T01:29:38-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39067#p39067 <![CDATA[Re: properly formatting asm code to make it QB ready]]>
Or maybe even add a placeholder string in the QB code, save the file, and then do the above but have the script replace the placeholder string in the QB source code file with the parsed output from the od parsing script.

Statistics: Posted by Erik — Tue Feb 23, 2021 1:29 am


]]>
2021-01-02T15:49:14-05:00 2021-01-02T15:49:14-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=39020#p39020 <![CDATA[properly formatting asm code to make it QB ready]]>
I want to know of a simple way to import assembly code into my QB program.

Because my only dos is DOSBOX (I'm running linux), this is what I am currently doing:

1. I write my assembly code
2. I compile it with nasm
3. I extract the data using linux od tool as follows (replacing binary with the filename containing the raw code:

Code:

od -tx1 -w999 binary
4. I highlight and copy all the hex codes
5. I paste them into my program, append a space and use QB mid$ function to extract each hex string and convert it into its actual byte.

The problem is everytime I paste, some codes don't have a space in-between and that's what screws up my program every time!

Is there an easier way to do it where I don't have to manually check to see that all hex codes are evenly spaced? It would be a pain to do this every time I want to change a character in my assembly code.

I would prefer the utility to be run in unix since I have copy and paste functionality there. Maybe there's something better than "od" or maybe I'm not using it perfectly for this purpose.

Thanks

Statistics: Posted by mikefromca — Sat Jan 02, 2021 3:49 pm


]]>