389 Posted Topics

Member Avatar for radu1989

1) We don't do homework for you. 2) Your explanation isn't clear enough. Hint: [code] nCount = | A - B | - 1 # Exclusive indexes nCount = | A - B | + 1 # Inclusive indexes [/code]

Member Avatar for wildgoose
-1
77
Member Avatar for dohadesigner

You could write a service application to detect additional IP addresses assigned to the local computer name. You could detect USB devices. Every USB device has a ManufacturerId and a ProductId. Turns out most types of devices are usually made by few companies. Have the service application have an internal …

Member Avatar for cash1846
0
152
Member Avatar for taggz19

The float to ASCII, clip, then ASCII to float is one method. You're only truncating by one decimal place! Not I said clip not round. So one method is [CODE=C] f = floor(N * 10.0f) * 0.1f; [/CODE]

Member Avatar for peter_budo
0
402
Member Avatar for NotNull
Member Avatar for urbancalli

This may make your issue more obvious... [CODE] Quotient : Remainder = Dividend / Divisor AL : AH = AX / (8-bit) AX : DX = DX:AX / (16-bit) EAX : EDX = EDX:EAX /(32-bit) [/CODE] You needed to specfy a data type snce you're using a memory reference [CODE] …

Member Avatar for NotNull
0
156
Member Avatar for Alex_

Review how VIDEO BIOS Interrupt 10h is suppose to function! You indicate string doesn't contain attributes with AX,1300h BUT Never set BL to indicate attribute to use! ALSO DL=column DH=Row Now check all your prints!

Member Avatar for Alex_
0
160
Member Avatar for Noliving

???? addi $t0, $t0, 0 # increment address in $t0 N = N + 0 Did you cut'n'paste improperly? Is code missing?

Member Avatar for wildgoose
0
153
Member Avatar for brando|away

You aren't being very clear! If you are using a more recent computer but somehow using an old DOS interface and not in an emulator, then you can use 32-bit instructions in Real Mode. An operand size instruction 66h is inserted before an instruction to command the processor to do …

Member Avatar for NotNull
0
143
Member Avatar for runtogetdone

You can download processor books but my favorite reference is the 32/64-bit 80x86 Assembly Language Architecture Book. Your mathematical operation and/or compares will set conditional flags. You then branch based upon those flags. For math there is a signed result and an unsigned result. That book pg. 292 [code] Signed …

Member Avatar for runtogetdone
0
115
Member Avatar for shahab03

code? Are you trapping for a keyword mult? How about trapping for operators 3 * 4 12 1 + 2 3 etc. Or even * 3 4 12

Member Avatar for wildgoose
0
3K
Member Avatar for namour84

Okay, I'm flipping this back at you. Note the comments and decide for yourself! By the way. Did you mean ((xvy)^z)*2 ((x OR y ) AND z ) * 2 then next time... ((x | y) & z) * 2 Or did you mean ((x OR Y ) XOR z …

Member Avatar for wildgoose
0
102
Member Avatar for Woady

Use a register to increment. Use a register as memory reference that you increment. Use a register for value loaded from memory. Use a register for current max index. You need to try to do this yourself. Post your code then we'll make comments!

Member Avatar for wildgoose
0
74
Member Avatar for shihara

This sounds more like an engineering task. There are websites like guru.com, etc. where you can post this kind of thing and find someone to build it for you! You will need to indicate whether you're trying to create a new wheel chair or retrofit an existing one! You will …

Member Avatar for wildgoose
0
171
Member Avatar for production.

Code, what code? If I understand your need you need edge triggering. Assuming high until pull down upon edge trigger. Here's some C code. You need to create an assembly language equivalent! [code=Asm] // global values byte sw = 0xff; byte swEdge = 0x0; [/code] [code=Asm] // Keyboard input loop …

Member Avatar for wildgoose
0
107
Member Avatar for G_buchCSC
Re: Pep

Why are you showing us the binary output. Please show the source code used to generate that binary output or atleast the list file that contains both binary and the source assembly!

Member Avatar for wildgoose
0
297
Member Avatar for laguna92651

I'm VERY VERY rusty on a 68HC12 [code] ldy #16 ;Loop 16 times Loop: asld ; Carry <- A <- B <- 0 MSB in carry psha ? ; a = Sum adda a,0 ; a=a+0+carry ? ; Sum = a pula dey bne $Loop [/code] Or branch around if …

Member Avatar for wildgoose
0
89
Member Avatar for kevincarroll

What you're trying to do is not useful to an application so why are you tinkering around in there? Most programmers who work in assembly can go their entire lives without working with system instructions. Are you planning on designing your own operating system or modifying an existing one? For …

Member Avatar for mathematician
0
218
Member Avatar for jhouns

A command line selector should be a table of ASCII commands with associated enumeration. When a string match is found, then use the enumeration with a jump table to call that command handler!

Member Avatar for jhouns
0
429
Member Avatar for zmwg

I think you misunderstand the syscall function. It doesn't return a four byte integer. It returns a string! You also aren't setting $a1 to maximum number of characters to read - 1. The function returns the string with a NULL terminaton. $a0 = buffer $a1 = sizeof buffer - 1 …

Member Avatar for zmwg
0
130
Member Avatar for Dani

You should enter your five integers by looping and storing in an array, then summing the array. In your code you don't need the compare as the addition will set the zero flag if the result is zero! [code=Asm] add sum, eax ; add entered value to accumulator sum jo …

Member Avatar for unimo
0
4K
Member Avatar for jedaprick

There is absolutely no reason for someone to be messing around with the binary in this era of assemblers and compilers. But if you are overly curious, run your debug. Open the command prompt and type debug followed by the file pathname of your exe file. You can then type …

Member Avatar for wildgoose
0
92
Member Avatar for masterjiraya

Different ways to solve your problem, but first a near relative jump is +127....-128 You can use an inverse branch logic. [code] if ! NeedToJumpUP goto next jmp far above next: [/code] You can also call a function so the jump distance isn't so far!

Member Avatar for wildgoose
0
398
Member Avatar for laguna92651

The ASR Arithmetic Shift Right instruction affects four flags. N (Negative) Bit set if sign bit (MSB) is set! Z (Zero) Bit set if result is zero. C (Carry) Bit Set with previous value in LSB. LSB gets clocked into carry. V (Negative) XOR (Carry). Bit is set if N:1 …

Member Avatar for wildgoose
0
269
Member Avatar for shahab03

Won't work the way you think! A float is 32-bit so only have about 4-5 digits of precision. That number is WAY TOO BIG! So it will definitely be put into exponential form provided the buffer is large enough! It also depends upon how long a buffer is acceptable!

Member Avatar for wildgoose
0
118
Member Avatar for shahab03

$LO = $s * $t [code] mult $t0,$t1 mfhi $t2 # HI mflo $t3 # LO la $a0, t0 equals li $v0, 4 #print_string syscall #t2 is HI #t3 is lOW # move $a0,$t0 move $a0,$t3 # Print lower 32-bits li $v0, 1 syscall [/code]

Member Avatar for wildgoose
0
66
Member Avatar for assembly101

The Auxiliary Carry (AF bit of Status Flags) is used for the carry out of bit 3 (0...7) into bit 4 for use in BCD operations! Think of it as a nibble carry!

Member Avatar for wildgoose
0
207
Member Avatar for shahab03

MIPS doesn't have a carry bit like the 80x86 so you have to emulate it! If result of lower 32-bit addition is less then any of the original values then a carry occured! So use the result of the compare to indicate a 0=no carry, 1=carry. Use that as the …

Member Avatar for shahab03
0
101
Member Avatar for nikolai090

You can also do it in BCD! No need for decimal to ASCII conversion! This is just one way to do this! [code=Asm] mov bh,'8' mov bl,'4' sub bh,'0' sub bl,'0' ;bh = 10's digit, bl=1's digit mov al,bl ; Handle 1's sub al,1 aas mov bl,al mov al,bh ; …

Member Avatar for NotNull
0
2K
Member Avatar for functionalCode
Member Avatar for mostafadotnet

Technically that's not a string reversal. If you were to push your characters into a buffer, then reverse them, that's a string reversal! But your code appears to be okay! Do you have a specific problem?

Member Avatar for wildgoose
0
456
Member Avatar for therstonsplace

LEAVE STI ALONE!!!!!!!!!!!!!! Interrupts are already turned on! If they weren't no input would be handled. No keyboard, no anything as they are all interrupt driven! There is a Serial BIOS in DOS. If you're using a simulator you're dependent upon what interrupts they actually implemented! Typicall DOS, keyboard, and …

Member Avatar for therstonsplace
0
218
Member Avatar for gauntex

Technically ASCII used to be 7-bit ASCII but with International characters etc. it is 8-bit so treat it as unsigned bytes. signed and unsigned have different comparisons! Digits is the smallest subset 10 of 255 posibilities, so checking for a digit is the better solution. '0' 0x30 48 '9' 0x39 …

Member Avatar for wildgoose
0
9K
Member Avatar for shahab03

[code=Asm] # Set Output buffer terminator (one character in length) # output[0] = character, output[1] = 0 terminator la $a0, output # output will be single character move $a1,$zero # Set our source buffer index to 0. sb $a1, 1($a0) # Set output buffer terminator for ASCIIZ output la $a0, …

Member Avatar for wildgoose
0
166
Member Avatar for OffbeatPatriot

You will require a semaphore to keep both threads from accessing the same data simultaneously. Thread#1 [CODE] {BLOCK} Var += 4; {UNBLOCK} [/CODE] Thread#2 [CODE] {BLOCK} Var -= 4; {UNBLOCK} [/CODE] Otherwise you run the risk of both simultaneously accessing the same argument. There is only one processor that I'm …

Member Avatar for BestJewSinceJC
-1
148
Member Avatar for dzhugashvili

Post padding isn't the optimal solution. Pre-padding is! Do a 32 bit write each write no loop! [code] unsigned char vect2enc[4][32]; uint32 *pAry = (uint32 *) vect2enc; *(pAry+0) = 0; *(pAry+1) = 0; : *(pAry+31) = 0; [/code] Of course this would be much faster in assembly code. [code=Asm] mov …

Member Avatar for dzhugashvili
-1
147
Member Avatar for jingo1126

What week in school of how many weeks? Can you turn on graphics mode and paint pixels yet? If so, that opens the window for many possibilities! Years ago for my Final Assembly Language project, I chose a circle and line drawing algorithm using self modifying code and the Bresenham …

Member Avatar for jingo1126
-1
160
Member Avatar for jingo1126

So only working with lower case in the 'a' to 'z' range for now? Simple cypher exchange ;cmp [si],'$' cmp byte ptr [si],'$' Put the '$' check at the bottom of the loop to save an extra jump each loop! You can put a pre-jump at the top to jump …

Member Avatar for NotNull
-1
154
Member Avatar for jingo1126

You're trying to buid a DOS application. Not a 32-bit or Extended DOS application. Keep SEG out of it. Technically your code segment is your data segment and your stack segment!

Member Avatar for jingo1126
-1
1K
Member Avatar for shahab03

Of course you need $a0 to be the address of the buffer An $a1 to be the maximum number of characters to read (buffer size - 1) as a terminator is written! Since the data is in $a0 you will need to do a load byte (LB) with 0 offset …

Member Avatar for wildgoose
-1
123
Member Avatar for shahab03

I would create a table of accumulated days DaysTbl[] = { 0, 31, 59, etc. } Find your day count base in the table. That index is your 0 based month! The difference is the day count that month! You could also use a days in each month and a …

Member Avatar for wildgoose
-1
114
Member Avatar for Dewey1040

[code=Asm] .data Prompt: .asciiz "\n Please insert a string: " Buffer: .space 60 Bye: .asciiz "\n **** Adios Amigo - Have a good day****" .globl main .text main: li $v0, 4 # system call code for Print String la $a0, Prompt # load address of prompt into $a0 syscall # …

Member Avatar for wildgoose
-1
1K
Member Avatar for ov3rcl0ck

Use the natural register size of the computer cpu mode. On a 16-bit Real Mode the assembler (or compiler) has to add an extra machine operand to instruct the processor that it is going to do a 32-bit operation. If in 32-bit Protected Mode the same has to occur for …

Member Avatar for wildgoose
-1
165
Member Avatar for maria azhari

Unfortunately that's not a short code snippet. You'll need to post your code and mention the tool set you're using!

Member Avatar for wildgoose
-1
46
Member Avatar for jingo1126
Member Avatar for jingo1126
-1
4K
Member Avatar for pokerstar

Something seems wrong with your C code. x = y while x >= y x = x - z If z < 0, one loop if z > 0, many many loops Despite your C code, Your assembly would be something similar to the following! If the entire C function …

Member Avatar for pokerstar
-1
177
Member Avatar for shopnobhumi

Due to pipelining modern day processors can't be calculating with a simple equation! Your teacher should already be familiar with this fact!

Member Avatar for wildgoose
0
76
Member Avatar for NotNull

For the character set move you could do it manually [code=Asm] mov cx, 0x1a0 / 2 CopyFnt: mov ax,es:[di] inc di mov ds:[si],ax inc si dec cx jne CopyFnt [/code]

Member Avatar for NotNull
0
134
Member Avatar for acidnynex

In my OpenGL code I use the following... [code=C] // _______________________________________________ // Perform operations to 'Projection' matrix stack glMatrixMode(GL_PROJECTION); glLoadIdentity(); // matrix = identity x Perspective // PI/4, 2/h, 0.1f, 1000.0f // mtxWorld = identity // D3DXMatrixPerspectieFovLH( &mtxProj, (Radians)PI/3, w/h, 1.0, 1000.0f ); gluPerspective( 60, // Field of View 60 …

Member Avatar for wildgoose
0
208
Member Avatar for shahab03

Are you using Macros in GNU? Typically the assembly code for an 80x86 would look like [code=Asm] $L1: cmp eax,ebx jne L1 [/code]

Member Avatar for shahab03
0
72
Member Avatar for shahab03

Can't do that due to forum rules. Hint: Review the forum for other MIPS code that uses key input and prints it and build your program ontop of that!

Member Avatar for wildgoose
0
34

The End.