Guard's Tumblr

Woxat of All Trades, Master of None

0 notes &

The Pain Scale

Ever heard a doctor ask you to rate your pain on a scale of 0 to 10? I remember when (after being hit by a car) they were asking me this, and I asked what ten was supposed to be. They said the worst pain I ever felt. I replied that obviously I would be at a ten since I’d never been injured this badly before.

I just thought it was kind of funny how terribly inaccurate the “pain scale” or whatever you want to call it is. Pain is something we’ve never been able to quantify, making it difficult for doctors to know what to do about your pain.

Something interesting to note, pain can be good, in fact that’s why pain exists. Pain is your body telling you NO. STOP THAT. Whatever it is you are doing to cause pain, your body is saying that it is a bad idea.

Some doctors think they need to eliminate pain. The truth is that they need to reduce pain into something manageable, not eliminate it. If someone is doing something that causes harm and not pain, they have no way to know they are doing something bad. If I had no pain throughout my ordeal, I would probably have taken longer to heal, because I would have done things that I shouldn’t have.

Filed under pain I don't know why I suddenly felt the need to write this Actually I do it was because I was reading a post on Hyperbole and a Half

2 notes &

Pointless Assembly Code

Writing some Assembly code because fuck. (To help a friend out with their programming course.) Actually I wrote this a long time back and am only posting it now in case his professor googles the submitted code and he doesn’t change it and then gets in trouble.

		.data
integer1:		.byte	0
integer2:		.byte	0
print_int:		.byte	1
read_int:		.byte	5
range:			.byte	20
print_string:	.byte	4
string:			.asciiz	" is the result\n"

		.text
main:		lw $v0,read_int		# service call
			syscall				# read an integer

			bltz $v0,main		# if less then zero, goto main
			lw $s0,range		# load range value
			sub $t0,$s0,$v0		# subtract twenty to check if above 20
			bgtz $t0,main		# if above zero, goto main

			sb $v0, integer1	# store in integer1

int2:		lw $v0,read_int		# service call
			syscall				# read an integer

			bltz $v0,int2		# if <0, jump to int2
			sub $t0,$s0,$v0		# sub 20 to check range
			bgtz $t0,int2		# if >0, jump to int2

			sb $v0, integer2	# store in integer2
#(integer1+integer2)*8
			lw $v0,integer1		# load integers
			lw $v1,integer2
			add $a0,$v0,$v1		# add them

			add $a0,$a0,$a0		# add this to itself (x2)
			add $a0,$a0,$a0		# add to self again  (x4)
			add $a0,$a0,$a0		# add AGAIN          (x8)
#print result
			lw $v0,print_int	# service call (result is already in $a0)
			syscall				# print result
			lw $v0,print_string	# service call
			la $a0,string		# load address of string
			syscall				# print message string

			j main				# repeat all

All that fucking does is asks for two integers, checks if they are in the range of 0-20 (asking again if they aren’t), then adds them together and multiplies that by 8, then does it all again. I wasn’t allowed to use li (load immediate) or mul (multiply) or subi (subtract immediate), all of which would have made this a bit easier.

This is using the MIPS instruction set btw.

Filed under assembly programming uggghhhhhh why I remembered why I quit writing assembly