Author Topic: need some information  (Read 20935 times)

Offline fingertangled

  • Jr. Member
  • *
  • Posts: 3
need some information
« on: February 28, 2011, 07:38:13 PM »
Im new to using nasm and a bit behind on assembly however what i would like to know is::::>
How does one use command prompt with int 10 and not have the prompt changing sizes????
try this it works:

sub ax,ax
int 10
}}}}apply code of choice{{{{{
mov ax,0x4c
int 0x21
ret

what it does in command prompt is that it shrinks the screen in me until returning at the end of the program

Offline Keith Kanios

  • Full Member
  • **
  • Posts: 383
  • Country: us
    • Personal Homepage
Re: need some information
« Reply #1 on: March 01, 2011, 12:07:51 AM »
Read up on INT 10h BIOS Functions on RBIL.

Particularly, think about how you may be triggering a different video mode with your code.

Offline fingertangled

  • Jr. Member
  • *
  • Posts: 3
Re: need some information
« Reply #2 on: March 01, 2011, 10:55:27 PM »
Hi... the information U gave Ive looked at but however with mud in my face...cuz I dont have the manuals or the extended years of practice that you have... when looking for a clue word. For instance to state that this interrupt with this number will give this type of  responce...

ie...>  int 10/ah=0x15  ; calls

MY system is Vista 32 with an nvidia video card... dont know if that could be the problem either due to the fact that the driver for a game I play took nearly 3 years before it worked again since the first installation.... so I need better information than just look here..

lastly Im an audio graphic learner it sinks in but a little slowly...Im not retarded though so please be patient..



fingertangled

Offline Keith Kanios

  • Full Member
  • **
  • Posts: 383
  • Country: us
    • Personal Homepage
Re: need some information
« Reply #3 on: March 02, 2011, 05:13:08 AM »
By the context of your post, it seems like you understand how to produce a COM file with NASM (-f bin) and run it under the Windows command prompt. If so, Windows' NTVDM is taking over to simulate a 16-bit Real Mode environment where-as Vista is running in a 32-bit Protected Mode environment. This is not precisely emulation as it is largely a function of the underlying architecture (Virtual 8086 Mode) but you can think of it as that... an "emulated" legacy PC BIOS (e.g. DOS) environment.

On to the code. Did you mean to say int 0x10 and not int 10? Note: int 10 (decimal) = int 0x0A (hexadecimal). BIOS function calls will typically be listed in hexadecimal form. Based on the above sub ax,ax and your indication of the command prompt changing sizes, I would have to say you actually meant and used int 0x10.

What does sub ax,ax do? In other words, what happens when you subtract something from itself? What value is thus in AX, and specifically AH, as a result of this operation? What value is in turn being supplied to int 0x10? What BIOS function is this ultimately being triggering as a result of your code? What parameters are being supplied to said BIOS function as a result of your code?

Note, that based on your code and the end result, you did do something very specific here, and it worked exactly as it should. The above information should help you figure out exactly why that happened.

zaminur143

  • Guest
Re: need some information
« Reply #4 on: March 14, 2011, 07:40:45 AM »
Im new to using nasm and a bit behind on assembly however what i would like to know is::::>
How does one use command prompt with int 10 and not have the prompt changing sizes????

Hi buddy, I am aslo new user of nasm. I needed these useful information. Thanks all.

Offline fingertangled

  • Jr. Member
  • *
  • Posts: 3
Re: need some information
« Reply #5 on: March 14, 2011, 05:49:17 PM »
Ok, lets try a different approach... when in Rbil the finding of scroll up and down was noted.  however  when

segment .data
msg db " it works ", 13,10,'$'

segment stack stack
        resb 2048
stacktop:
segment .bss

hirw resw 1
hicl resw 1
lwrw resw 1
lwcl resw 1
atrb resw 1 ; tribute 4 blanking

segment .text

..start:

mov ah, 12h
mov [atrb],bh
int 10h

mov ah, 11h    ; get window
mov [hirw],ch
mov [hicl],cl
mov [lwrw],dh
mov [lwcl],dl
int 10h

mov ah, 6h
mov al, 0h
mov bh, [atrb]
mov ch, [hirw]
mov cl, [hicl]
mov dh, [lwrw]
mov dl, [lwcl]
int 10h

mov ah, 10h
mov ch, [hirw]
mov cl, [hicl]
mov dh, [lwrw]
mov dl, [lwcl]
int 10h

xor ax,ax
mov ax, data
mov ds, ax
mov ax, stack
mov ss, ax
mov sp, stacktop

; main controlling code
extra code
;

leave
ret

this also shrinks the command prompt set at 130 by 58 for usability of personal reasons. Now Ive looked at monitor tables, VxD tables, and so on and Im lost on which direction to look next.

 My goal in this is to find a way of making programs that everyone can use, not just me.

can you give a polite shove in a direction to look next?

but I say thanx for your help so far

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: need some information
« Reply #6 on: March 15, 2011, 08:18:57 AM »
Oh, my...

Code: [Select]
segment .data
msg db " it works ", 13,10,'$'

segment stack stack
        resb 2048
stacktop:
segment .bss

hirw resw 1
hicl resw 1
lwrw resw 1
lwcl resw 1
atrb resw 1 ; tribute 4 blanking

segment .text

..start:

; you need to do this first!!!

;xor ax,ax ; why?
mov ax, data
mov ds, ax
; you may want to do es, too... maybe...

; I know it says it in the Manual,
; but if you've declared the stack
; properly (which you have), dos
; loads us with ss:sp all set.
; there is no need to do this.

;mov ax, stack
;mov ss, ax
;mov sp, stacktop

mov ah, 12h
mov [atrb],bh
int 10h

bh doesn't hold the attribute until after the int 10h! Do the int 10h first, then store the result.

Code: [Select]
mov ah, 11h    ; get window
mov [hirw],ch
mov [hicl],cl
mov [lwrw],dh
mov [lwcl],dl
int 10h

Same problem here. Do the int 10h first, then store the results of it!

Code: [Select]
mov ah, 6h
mov al, 0h
mov bh, [atrb]
mov ch, [hirw]
mov cl, [hicl]
mov dh, [lwrw]
mov dl, [lwcl]
int 10h

mov ah, 10h
mov ch, [hirw]
mov cl, [hicl]
mov dh, [lwrw]
mov dl, [lwcl]
int 10h

; we did this first...
;xor ax,ax
;mov ax, data
;mov ds, ax
;mov ax, stack
;mov ss, ax
;mov sp, stacktop

; main controlling code
;extra code
;

;leave ; leave? we didn't "enter"!
;ret ; not from an .exe file!

; you want to print "it worked!" here, right?

; may want to pause to admire it...
mov ah, 0
int 16h

mov ax, 4C00h ; ah=4Ch, exit to dos, al=0, "no error"(?)
int 21h

I don't know what that's supposed to do, exactly, but I think it'll work better with the suggested changes...

Quote
My goal in this is to find a way of making programs that everyone can use, not just me.

You may want to ditch dos and bite the Windows bullet.

Best,
Frank