Mov ax,data
mov ds,ax
mov dl,05h
up2: lea si,ser1
mov cl,05h
up1: mov al,ds:[si]
mov ah,al
inc si
cmp al,ds:[si]
jc down
mov ah,ds:[si]
mov ds:[si],al
dec si
mov ds:[si],ah
inc si
down:dec cl
jnz up1
dec dl
jnz up2
int 3h
Chat with our AI personalities
To convert byte to String in java use the String(bytes, UTF-8); //example for one encoding type. You must know the special encoding that contains a variety of characters.
Dependion on the variable there are several methods to do it, this can only be applied to primitive types and arrays, for an array its the "name_of_array.length", for the arraylist this change just a little, it would be like "name_of_array_list.size()", for an int, double, float, long, byte, it would be like "name_of_variable.LENGTH" this is a public variable so you dont need a get, an finally for the String there is a method "name_of_string.length()" this would return the size of this String
Not sure what you mean; if you want to measure the "input size" in bytes, that would probably be 8 bytes, since integers typically use 4 bytes.
There is no boolean in C, we usually use int/short/char to store logical values.
An object in Java may contain a small amount or a large amount of memory - it depends almost entirely on what you store in it. For example, a String is an object. Now, you can have a String that contains 10 characters - that object will contain 20 bytes (2 bytes per character - characters are stored as Unicode), plus a small amount of overhead. The amount of overhead may vary, depending on the specific Java implementation. Another String, which contains 100 million characters, will be stored using 200 million bytes (plus a small amount of overhead). I believe the JVM may also round the space used up by an object up - for example, to the closest power of two. But once again, this is implementation-specific.