Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3281518
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:49:29+00:00 2026-05-17T19:49:29+00:00

Hey some im writing a bootloader using nasm a virtual machine ect. Anyhow, im

  • 0

Hey some im writing a bootloader using nasm a virtual machine ect. Anyhow, im using vram to display background and font color changes triggered by keys s, d, f, g. S switches the color of the font with the background color. I know how this can be done but i do not know the proper way. vram is setup as so 2 bytes the first is the character, the second is its attributes. These are background then character color. So i need to take these and switch them. That would switch the font color and the background color. How do i actually do it with code?

; s key
;///////////////////////////////////////////////////////////
.s:
mov bx,0xb800       ;direct video memory access 0xB8000
mov es,bx
xor bx,bx       ;es:bx : 0xb8000
mov dh,0        ;row from 0 to 24
mov dl,0        ;col from 0 to 79


    .loops1:
inc bx
mov byte [es:bx], 0ah   ;attribute 
inc bx

inc dl
cmp dl,80       ;col 0-79
jne .loops1
mov dl,0
inc dh
cmp dh,25       ;row 0-24
jne .loops1 
jmp .kbin

Second question:
Im using this loop to detect key’s how could i change these keys to Ctrl + key.

.kbin:
 mov ah,10h  ;Read from keyboard
                ;ah scan code, al ascii char
 int 16h
 cmp al, 53h   ;uppercase s
 je .s

 cmp al, 73h   ;lowercase s
 je .s

 cmp al, 44h   ;uppercase d
 je .d

 cmp al, 64h   ;lowercase d
 je .d

 cmp al, 46h   ;uppercase f
 je .f

 cmp al, 66h   ;lowercase f
 je .f

 cmp al, 47h   ;uppercase g
 je .g

 cmp al, 67h   ;lowercase g
 je .g

 jmp .kbin

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T19:49:29+00:00Added an answer on May 17, 2026 at 7:49 pm

    This should do it:

        mov ax, 0xb800
        mov es, ax
        mov ds, ax ; both pointing at vram area
        xor si, si
        xor di, di
        mov cx, num_chars
    loop1:
        movsw // reads a word from ds:si into ax
        rol ax, 8 // switches the bytes in ax
        stosw // puts the word back
        dec cx
        jne loop1
    

    For the second, use function 2 for int 16h.

    Yeah, and get some documentation. Maybe you’ll like Tech: http://www.intel-assembler.it/portale/5/A-desktop-assembler-utility-program/A-desktop-assembler-utility-program.asp

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey right now I'm using jQuery and I have some global variables to hold
Hey everyone, I'm using Virtual PC and working with a virtual hard disk (*.vhd)
hey im writing a c# flv2mp3 converter and i could need some help. flv
Hey im writing an echo client, and for some reason the connectsock function is
Hey guys/gals I'm writing a python script that fixes some duplicate issues on my
Hey, I'm writing a network application, in which I read packets of some custom
hey I i am writing a Program in C++ and for some reason the
Hey, I'm having some problems writing a batch file where I need to specify
Hey there. I am writing some PHP that needs to check to see if
Hey there. I am writing some PHP that needs to check to see if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.