does anyone know how to write a getkey command for ASM programming for the 80x86 processor?
does anyone know how to write a getkey command for ASM programming for the 80x86 processor?
It's easy if you've learned some assembly first.
"The Internet treats censorship as damage and routes around it." - John Gilmore
this is what i have soo far, plese let me know if im wrong.
now im stuck with the next bit of the code.Code:mov ah, 11 int 16h
also do you know how to do clearscreen without using dos and bios functions?
Thanks
Last edited by peckitt99; 11-19-2006 at 01:35 PM.
Why don't you use asm to call C functions? That is much easier.
well our assignment is written in c code but we have to fill in the rest of the functions using ASM
Show us your assignment. Also, you might want to consider a book like Assembly Step-by-step.
my assignment is too big to put up on here, i do have a few books but its not really that good, lol. but like i said in the other post i just have to fill out functions with the asm code rather than all in c. (The Program is "MineSweeper")
Try giving us, say, one function that you need.
here is a clip with a few functions that is needed
Code:// Clear screen and output the title and points text ClearWindow(0,0,SCREEN_WIDTH-1,SCREEN_HEIGHT-1,BLOCK_CHAR, BLUE_ON_BLUE); WriteAt(TitleStr.X, TitleStr.Y, TitleStr.Text, YELLOW_ON_BLUE); WriteAt(NumGoesStr.X, NumGoesStr.Y, NumGoesStr.Text, NumGoesStr.Colour); // Draw the sea ClearWindow(GridLeft,GridTop,GridLeft+GridWidth-1,GridTop+GridHeight-1,SEA_CHAR, WHITE_ON_BLUE); // Enable the dos mouse cursor and enter the game-on loop until killed or quit using escape MouseCursorOn(); do { // Get mouse position and test whether left button is down. If it is then wait for it to be // released. If the mouse is in the grid area, check if it is on a mine. If it is then // game over and exit this loop. If not, write the risk value on the grid and update // the points string ReadMouse(&Mouse); GotoXY(Mouse.Col,Mouse.Row); if (Mouse.Buttons.Button.Left == PRESSED) { while (Mouse.Buttons.Button.Left == PRESSED) ReadMouse(&Mouse); // Wait for release if (Mouse.Col >= GridLeft && Mouse.Col < GridLeft+GridWidth && Mouse.Row >= GridTop && Mouse.Row < GridTop+GridHeight) { if (Grid[Mouse.Row-GridTop][Mouse.Col-GridLeft] == A_MINE) { GameOver();
You're not in DOS any more (probably). Windows works a bit differently.Code:mov ah, 11 int 16h
"The Internet treats censorship as damage and routes around it." - John Gilmore
ah right im using turbo debugger if that help and the other functions that i need to complete are
anyone know of any good websites that can help me learn this?Code:ClearWindow WriteAt StrLen IntToStr GetKey StrCpy MouseCursorOff and Off ReadMouse MemSet
->Code:MouseCursorOff and Off
?Code:MouseCursorOff and On
You could try google . . . http://www.google.ca/search?hl=en&q=...tutorial&meta=
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Code:Mouse cursor on DOS _asm { mov ax,0001h int 33h } Windows ShowCursorPos(TRUE); Mouse cursor off DOS asm { mov ax,0002h int 33h } Windows ShowCursorPos(FALSE);
For keyboard you want to hook interrupt 09h, not the BIOS key handler at 16H.