16-bit

ASM EXE program 16bit: Error changing size of memory

匆匆过客 提交于 2020-12-26 04:27:59
问题 I write EXE program with SMALL model. I want to load other programs with the help of my program. I read that first of all I must free some memory. I use DOS 4Ah INT 21h interrupt. But I have error 7 (control units memory is destroyed) in AX when use it. What I made incorrect? ;-------------------MACRO----------------- println MACRO info push ax push dx mov ah, 09h mov dx, offset info int 21h ;print new line mov dl, 10 mov ah, 02h int 21h mov dl, 13 mov ah, 02h int 21h pop dx pop ax ENDM ;----

ASM EXE program 16bit: Error changing size of memory

给你一囗甜甜゛ 提交于 2020-12-26 04:25:32
问题 I write EXE program with SMALL model. I want to load other programs with the help of my program. I read that first of all I must free some memory. I use DOS 4Ah INT 21h interrupt. But I have error 7 (control units memory is destroyed) in AX when use it. What I made incorrect? ;-------------------MACRO----------------- println MACRO info push ax push dx mov ah, 09h mov dx, offset info int 21h ;print new line mov dl, 10 mov ah, 02h int 21h mov dl, 13 mov ah, 02h int 21h pop dx pop ax ENDM ;----

manipulating 32 bit numbers with 16 bit registers in 8086

五迷三道 提交于 2020-12-25 04:00:57
问题 Im trying to write a program which get two 6-digit decimal numbers and show the addition of them, but in 16 bit 8086 i defined numbers as double word and put LO in WORD 1 and HO in word 2. similar to below code but i dont have any idea to do next, can any body suggest me algorithm for next operations? Thnx x dd(?) next_no: mov cl,2 mov ch,4 two_bit: getch sub al,30h mov bl,10 mul bl mov di,ax add word ptr x+2,di dec cl jnz two_bit fourbit: getch sub al,30h mov bl,10 mul bl mov di,ax add word

Reducing sample bit-depth by truncating

…衆ロ難τιáo~ 提交于 2020-05-26 09:59:10
问题 I have to reduce the bit-depth of a digital audio signal from 24 to 16 bit. Taking only the 16 most significant bits (i.e. truncating) of each sample is equivalent to doing a proportional calculation (out = in * 0xFFFF / 0xFFFFFF)? 回答1: I assume you mean (in * 0xFFFF) / 0xFFFFFF , in which case, yes. 回答2: You'll get better sounding results by adding a carefully crafted noise signal to the original signal, just below the truncating threshold, before truncating (a.k.a. dithering). 回答3: x *

Can't clear entire screen in 16-bit real mode Assembly

戏子无情 提交于 2020-01-21 11:33:58
问题 I'm trying to clear the screen in my simple 16-bit real mode operating system. Below is the code: clearScreen: pusha mov ah, 0x7 mov al, 0 int 0x10 popa ret I read that setting al to 0 and calling the scroll screen interrupt would clean the screen but it only seems to change the colour of the first line to grey. Thanks to anyone who can explain why this is not working. 回答1: The problem is that int 0x10 function 0x07 takes more parameters than you've given. Specifically, AH = 07 = scroll

Can't clear entire screen in 16-bit real mode Assembly

守給你的承諾、 提交于 2020-01-21 11:33:50
问题 I'm trying to clear the screen in my simple 16-bit real mode operating system. Below is the code: clearScreen: pusha mov ah, 0x7 mov al, 0 int 0x10 popa ret I read that setting al to 0 and calling the scroll screen interrupt would clean the screen but it only seems to change the colour of the first line to grey. Thanks to anyone who can explain why this is not working. 回答1: The problem is that int 0x10 function 0x07 takes more parameters than you've given. Specifically, AH = 07 = scroll

Problems with BIOS delay function (INT 15h / AH = 86h)

狂风中的少年 提交于 2020-01-17 05:46:20
问题 I began studying assembly this year in my school, and we just started learning about pixels. Our teacher gave us some code and told us to mess around with it, he also told us to try and implement delay in the code(ah=86h|int 15h), but when i tried to use it the location and colors of some pixels got changed, and i don't understand why code: (just a piece of the code, there is some more there also get's ruined after the delay) mov cx, 20 add [y], 2 mov dx, [y] paint1RowOf10: mov bh, 0h mov bx,

Converting a decimal to a 16 bit binary using unsigned char and without string [closed]

这一生的挚爱 提交于 2020-01-06 06:40:21
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year . My code works if I use operand 1 and operand 2 as integers. Using unsigned char operand 1 does not work. Can you help me? int ALU(unsigned char operand1, unsigned char operand2) { printf("Enter Operand 1(in decimal): "); scanf("%d",&operand1); printf("\nEnter Operand 2(in decimal): "); scanf("%d",

C# bitwise shift on ushort (UInt16)

淺唱寂寞╮ 提交于 2020-01-03 08:14:12
问题 I need to perform a bitwise left shift on a 16-bit integer (ushort / UInt16), but the bitwise operators in C# seem to apply to int (32-bit) only. How can I use << on an ushort, or at least get to the same result with a simple workaround? 回答1: Cast the resulting value back into ushort after shifting: ushort value = 1; ushort shifted = (ushort)(value << 2); 来源: https://stackoverflow.com/questions/3819593/c-sharp-bitwise-shift-on-ushort-uint16

OpenGl 16 bit display via Tao/C#

倾然丶 夕夏残阳落幕 提交于 2020-01-02 14:10:14
问题 I have some scientific image data that's coming out of a detector device in a 16 bit range which then gets rendered in an image. In order to display this data, I'm using OpenGL, because it should support ushorts as part of the library. I've managed to get this data into textures rendering on an OpenGL 1.4 platform, a limitation that is a requirement of this project. Unfortunately, the resulting textures look like they're being reduced to 8 bits, rather than 16 bits. I test this by generating