[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

simple x86 help

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 17
Thread images: 5

File: download.png (3KB, 204x204px) Image search: [Google]
download.png
3KB, 204x204px
just asking for a little help in displaying the output of this i dont get it got some help. am almost done with this.
"
_main PROC 
; generate handles for I/O
; whandle = GetStdHandle(STD_OUTPUT_HANDLE);
push STD_OUTPUT_HANDLE
call _GetStdHandle@4
mov whandle, eax

; rhandle = GetStdHandle(STD_INPUT_HANDLE);
push STD_INPUT_HANDLE
call _GetStdHandle@4
mov rhandle, eax

; write the header
writeConsoleString whandle, obuf0, SIZEOF obuf0, bout

; loop until user quits, collecting info for queries
; process the query by searching the selected array and displaying the
; query results
L0: writeConsoleNL whandle, bout
; write the Domestic/Import prompt
writeConsoleString whandle, obuf1, SIZEOF obuf1, bout
; read char in
readConsoleString rhandle, ibuf1, SIZEOF ibuf1, bin

; did the user request to quit? Or save the users dbase choice
MOV al, ibuf1[0] ; get the first char
OR al, 020h ; force lower case
CMP al, 'r' ; R
JNE L1 ; no
MOV ebx, OFFSET FamCars ; load pointer to the first record
JMP L2

L1: CMP al, 't' ; save the import array data
JNE L3 ; anything else is quit
MOV ebx, OFFSET FamCars ; load pointer to the first record
ADD ebx, SIZEOF Auto ; and index to the second

L2: PUSH ebx ; pointer to struct to be displayed
CALL displayCarInfo
ADD esp, (1 * 4)

JMP L0 ; and loop

L3: push 0
call _ExitProcess@4 ; normal termination with error code 0 == no error
_main ENDP
END _main

basically everything is working fine it gets sorts it theres other macros and such. but im having trouble outputing the structure

here is that proc
displayCarInfo PROC
doPrologue 0
POP ebx ;pointer in
IMUL OFFSET Auto
writeConsoleString whandle, OFFSET FamCars, SIZEOF Auto, bout


doEpilogue
RET
displayCarInfo ENDP


i just dont know how display it with the ebx as a pointer.
>>
>>60340123
I fuckd up the formatting but im just having trouble with using the ebx as a pointer in the display, im getting erors
>>
File: 1484612005131.jpg (12KB, 400x462px) Image search: [Google]
1484612005131.jpg
12KB, 400x462px
>>60340123
>not pure GNU asm
>>
>>60340176
suicide > anything other than programming > programming
>>
>>60340225
Why are you programming then?
>>
>>60340235
I have to do it for any computer science centered field at any schools in my town
>>
>>60340123
there is your problem
the formatting is all fucked up
>>
>>60340302
that just gets the offset of whatever i put in though.and a proc called displayCarInfo will just use the offset to the car info. Ill link a complete txt in a sec.
>>
>>60340123
Link to compete txt
https://drive.google.com/drive/u/0/my-drive

if any nigger wants to do / fix it for me ill give $10 plz let me sleep should just be the

displayCarInfo PROC
>>
>>60340419
Correction

https://drive.google.com/open?id=0Bz2aZGhDuSCUWklYN3ZrUU9IZkk
>>
>>60340419
Outsource it to a currynigger. If you're looking for them here I direct you to our daily (sometimes multiple daily) Windows / IDE / Java / etc. threads.
>>
>>60340176
jesus christ kill yourself and your demented syntax
>>
>>60340123
are you popping the return address?
try accessing your pointer with [esp+4] instead.
>>
File: 1486907982201.gif (415KB, 480x238px) Image search: [Google]
1486907982201.gif
415KB, 480x238px
>>60341530
>>
>>60340176
>GNU asm
it is called at&t syntax
>>
>>60341859
it's called severe brain damage.
>>
File: 1486768607290.gif (621KB, 440x247px) Image search: [Google]
1486768607290.gif
621KB, 440x247px
>>60341859
>>60341912
Thread posts: 17
Thread images: 5


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.