assembly


Using hex numbers in MSP430 assembler


I'm new to assembly (we are using it at school with an MSP430 controller) and I'm trying to do two things.
moving an hex number to a certain location: mov #FFFh, R5 (moving it into the fifth register)
comparing an hex number with another: cmp #FFFh, #45
mov.b #0, R4 ; indice
mov.b #0, R5 ; contatore
bis.b #00000001b, P1DIR ; led rosso
bis.b #10000000b, P4DIR ; led verde
main_loop: cmp #19, R5
jz end
cmp #FFFFh, 2C00h(R4)
jnz nope
jmp yep
nope: inc.b R4
jmp main_loop
yep: inc.b R4
inc.b R5
jmp main_loop
end: cmp #5, R5
jge red_led
jmp green_led
red_led: bis.b #00000001b, P1OUT
green_led: bis.b #10000000b, P4OUT
The compiler log (we are using CCS, CodeComposer) says:
"../main.asm", ERROR! at EOF: [E0300] The following symbols are undefined:
FFFFh
How can I fix this?
A word starting with a digit (0 … 9) is interpreted as a number.
A word starting with a letter (A … Z) is interpreted as a name (of a register or a variable or a label).
So when a hexadecimal number starts with a letter, you must add a zero:
cmp #0FFFFh, 2C00h(R4)

Related Links

How to do conditional compilation with TASM?
Why is “inc dword [esp + ebx]” faster than “inc [esp]”?
declaration of constant strings in x86 assembly language
what's the difference between user-level directives and primitive directives in NASM?
What if there is no return statement in a CALLed block of code in assembly programs
Why is it necessary to use '$' sign in AT & T assembly?
In MIPS Assembly language, when do you know when to use syscall?
Kernel worked in emu8086 but not in virtual box with floppy controller
What's the easiest way to determine is the register value equal to zero or not?
How is associated data stored when pushing and popping register contents
How is the “__ARM_common_switch8 PROC” produced in Keil uVision4
Error when accessing vector table
Are assembly language programs restricted by kernel modes as well?
Want to take value from input procedure to output procedure using push and pop
Get system time with BIOS interrupt in assembly
How to convert x86_64 64-bit register names to their corresponding 32-bit register names in GNU assembly?

Categories

HOME
windows
jmeter
pagination
zend-framework
serialization
camera
bitbucket-api
yandex
3d-reconstruction
maxscript
jquery-ui
project
little-proxy
dkim
mautic
docx
capistrano3
red5
easyphp
drive
undertow
squashfs
jquery-callback
froala
jackson-modules
underscore.js
datastax-enterprise-graph
gp
failover
boost-asio
sql-delete
recurrent-neural-network
verifiable-c
google-data-api
c9.io
datacachefactory
android-ibeacon
oracle-service-bus
dynamic-linq
vugen
magic-draw
java-6
er-diagram
universal-analytics
rsa-archer-grc
juice-ui
angular2-testing
drawstring
x-tag
jquery-jscrollpane
wso2developerstudio
eigenvector
simevents
deep
riot
dynamics-nav-2016
gocql
fuelcms
jdk1.7
sql-server-data-tools
keyup
telepat
dbaccess
pseudo-class
tinyxml
ios8-extension
gd-graph
sphinxql
superscrollorama
resource-management
qi4j
fragmenttransaction
web-farm
stress
google-floodlight
creole
mbeans
vs-android
folding
zen
cfwindow
asynchronous-wcf-call
software-lifecycle
fault-tolerance
sqlobject

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App