Mike Chambers
Veteran Member
- Joined
- Sep 2, 2006
- Messages
- 2,621
http://www.youtube.com/watch?v=1rAurls9-G0
i started working on this yesterday. excuse the unprofessional demo.
i have a question for you ASM guys. i want to dynamically "assemble" some binary code into a string in QB that will let me CALL ABSOLUTE to it. i need it to copy a memory block of arbitrary size from a specified seg : ptr to another specified seg : ptr
you probably see where i'm going with this.. string variables to segment A000h for fast video writes.
what would be the simplest way of implementing this binary code??
if you need this info, here's the CALL ABSOLUTE info from the QBX help file:
so, ideally i could do it like this:
lets say i have 320 bytes of pixel data to write starting at 0, 0 in 320x200x8.. for simplicity's sake, we'll just make them all of value 255 here:
bincode$ = asmcodeformemoryblahblahineedhelpwiththat
pixels$ = string$(320, chr$(255))
vidoffset% = 0
pixelcount% = len(pixels$)
CALL ABSOLUTE VARSEG(pixels$), VARPTR(pixels$), &HA000, vidoffset%, pixelcount%, VARPTR(bincode$)
obviously, i could do stuff like change vidoffset% to 320 and it'd copy the pixel data to the SECOND line rather than the first. you get what i'm doing here, you guys are smart that's why i'm here
how would the binary code handle the 5 variables i'm feeding it? if i know that, i can probably just write the code myself with MOVs and stuff.
i started working on this yesterday. excuse the unprofessional demo.
i have a question for you ASM guys. i want to dynamically "assemble" some binary code into a string in QB that will let me CALL ABSOLUTE to it. i need it to copy a memory block of arbitrary size from a specified seg : ptr to another specified seg : ptr
you probably see where i'm going with this.. string variables to segment A000h for fast video writes.
what would be the simplest way of implementing this binary code??
if you need this info, here's the CALL ABSOLUTE info from the QBX help file:
Code:
│CALL Absolute ([argumentlist,] integervariable%)
│
│ ■ argumentlist Arguments passed to a machine-language
│ procedure as offsets (near pointers) from the
│ current data segment.
│ ■ integervariable% The offset from the current code segment, set
│ by DEF SEG, to the starting location of the
│ procedure.
so, ideally i could do it like this:
lets say i have 320 bytes of pixel data to write starting at 0, 0 in 320x200x8.. for simplicity's sake, we'll just make them all of value 255 here:
bincode$ = asmcodeformemoryblahblahineedhelpwiththat
pixels$ = string$(320, chr$(255))
vidoffset% = 0
pixelcount% = len(pixels$)
CALL ABSOLUTE VARSEG(pixels$), VARPTR(pixels$), &HA000, vidoffset%, pixelcount%, VARPTR(bincode$)
obviously, i could do stuff like change vidoffset% to 320 and it'd copy the pixel data to the SECOND line rather than the first. you get what i'm doing here, you guys are smart that's why i'm here
how would the binary code handle the 5 variables i'm feeding it? if i know that, i can probably just write the code myself with MOVs and stuff.
Last edited: