How do I do, in VB, this program that I built in C++/ASM:
I don't care if it's not Assembler, I just need it to do the same thing. DOS or Windows, it doesn't matter.
Code:
#include <dos.h>
#define byte char
enum BOOL { TRUE = -1, FALSE };
void ViewMode(BOOL GraphicsMode)
{
asm MOV AH, 00h
if(GraphicsMode) asm MOV AL,13h
else asm MOV AL,03h
asm INT 10h
}
void PutPixel(int X, int Y, byte Color)
{
asm {
MOV AX,0A000h
MOV ES,AX
MOV BX,[X]
MOV DX,[Y]
MOV AL,[Color]
MOV DI,BX
MOV BX,DX
SHL BX,6
SHL DX,8
ADD DI,BX
ADD DI,DX
MOV ES:[DI],AL
}
}
int main()
{
ViewMode(TRUE); // 320x200x8-bit color
PutPixel(50,50,1); // (50,50) Blue
PutPixel(50,100,2); // (50,100) Green
PutPixel(100,50,3); // (100,50) Cyan
PutPixel(100,100,4); // (100,100) Red
delay(5000); // 5-sec wait
ViewMode(FALSE); // Text-mode
return 0;
}
Here's what I've got so far:
HEEEEEELP!!!!!